import request from "@/utils/request";
// 调用权限
export default {
  //获取用户列表
  getList(data) {
    return request({
      url: "/api/accounts/users/",
      method: "get",
      params: data
    });
  },
  //获得用户信息
  getUsersInfo(data) {
    return request({
      url: "/api/accounts/users/info/",
      method: "get",
      params: data
    });
  },
  //修改用户信息
  changeInfo(data) {
    return request({
      url: "/api/accounts/users/change_info/",
      method: "put",
      data
    });
  },
  //修改用户密码
  changePwd(data) {
    return request({
      url: "/api/accounts/users/change_pwd/",
      method: "put",
      data
    });
  },
  //修改手机号码
  changePhone(data) {
    return request({
      url: "/api/accounts/users/change_phone/",
      method: "put",
      data
    });
  },
  //发送手机验证码
  smscode(phone) {
    return request({
      url: "/api/accounts/smscode/" + phone + "/",
      method: "get"
    });
  },
  getUsersRoles(id) {
    return request({
      url: "/api/accounts/users/" + id + "/roles/",
      method: "get"
    });
  },
  //重置用户密码
  resetUserPassword(id) {
    return request({
      url: "/api/accounts/users/" + id + "/reset_password/",
      method: "post"
    });
  },
  accountsUnlock(id) {
    return request({
      url: "/api/accounts/users/" + id + "/unlock/",
      method: "get"
    });
  },
  //添加用户
  toAdd(data) {
    return request({
      url: "/api/accounts/users/",
      method: "post",
      data
    });
  },

  //编辑用户
  toEdit(id, data) {
    return request({
      url: "/api/accounts/users/" + id + "/",
      method: "put",
      data
    });
  },
  //删除用户
  toDelete(id) {
    return request({
      url: "/api/accounts/users/" + id + "/",
      method: "delete"
    });
  },
  //获取选择框的部门列表
  getDeptsList() {
    return request({
      url: "/api/accounts/depts/",
      method: "get"
    });
  },
  //获取部门列表(简易)
  getSimpleDeptList(data) {
    return request({
      url: "/api/accounts/depts/simple/" ,
      method: "get",
      params:data
    });
  },
  //根据权限获得展示的部门
  getSimpleDeptList2(data) {
    return request({
      url: "/api/accounts/simple_depts2/" ,
      method: "get",
      params:data
    });
  },
  //校领导列表
  getActivityLeader() {
    return request({
      url: "/api/activity/leader/" ,
      method: "get"
    });
  },
  getAllDeptsUsers() {
    return request({
      url: "/api/accounts/depts_users/" ,
      method: "get"
    });
  },
  getAllDeptsLeaders() {
    return request({
      url: "/api/accounts/depts_leaders/" ,
      method: "get"
    });
  },
  getAllDeptsXzjb(data) {
    return request({
      url: "/api/accounts/depts_xzjb/" ,
      method: "get",
      params:data
    });
  },
  getAllDeptsMeet(data) {
    return request({
      url: "/api/accounts/depts_meet/" ,
      method: "get",
      params:data
    });
  },
  accountsUsersSms(data) {
    return request({
      url: "/api/accounts/users/sms/" ,
      method: "put",
      data
    });
  },
  uploadAvatar(data) {
    return request({
      url: '/api/upload_avatar/',
      method: 'post',
      data: data
    })
  },
  //获取所有部门所有人员
  getAccountsAllUsers(data) {
    return request({
      url: "/api/accounts/select/" ,
      method: "get",
      params:data
    });
  },
  usersTongbu(data) {
    return request({
      url: "/api/oauth/users/tongbu/",
      method: "get",
      params:data
    });
  },
};
